var e = require;
var t = module;
var o = exports;
var ii, nn = this && this.__extends || (ii = function (t, e) {
    return (ii = Object.setPrototypeOf || {
        __proto__: []
    }
        instanceof Array &&
        function (t, e) {
            t.__proto__ = e
        } ||
        function (t, e) {
            for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
        })(t, e)
},
    function (t, e) {
        function o() {
            this.constructor = t
        }
        ii(t, e),
            t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
    }
),
    rr = this && this.__awaiter ||
        function (t, e, o, i) {
            return new (o || (o = Promise))(function (n, a) {
                function r(t) {
                    try {
                        l(i.next(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function s(t) {
                    try {
                        l(i.
                            throw(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(t) {
                    var e;
                    t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
                        t(e)
                    })).then(r, s)
                }
                l((i = i.apply(t, e || [])).next())
            })
        };
var oo = (this && this.__decorate) ||
    function (e, t, a, n) {
        var i,
            o = arguments.length,
            s = o < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, a)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);
        else
            for (var r = e.length - 1; r >= 0; r--)
                (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
        return o > 3 && s && Object.defineProperty(t, a, s), s;
    };
Object.defineProperty(o, "__esModule", { value: !0 });
var a = e("BaseModuleUI"),
    n = e("GlobalParams"),
    i = e("AudioManager"),
    r = cc._decorator,
    s = r.ccclass,
    l = r.property,
    _ = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.guide_info_view = []),
                (t.continue_btn = null),
                (t.guide_index = 0),
                (t.hand_anime = null),
                (t.hand_pos = [cc.v2(100, 0), cc.v2(100, 0), cc.v2(0, -100)]),
                t
            );
        }
        return (
            nn(t, e),
            (t.prototype.initView = function () {
                (this.guide_index = 0), this.showGuideInfo(), this.continue_btn.on("click", this.showNextGuide, this);
            }),
            (t.prototype.showGuideInfo = function () {
                var e = this;
                this.continue_btn.active = !1;
                for (var t = 0; t < this.guide_info_view.length; t++)
                    this.guide_info_view[t].active = t == this.guide_index;
                i.default.getInstance().playFx("guide_" + (this.guide_index + 5)),
                    this.showhandAnime(),
                    this.scheduleOnce(function () {
                        e.continue_btn.active = !0;
                    }, 2);
            }),
            (t.prototype.showNextGuide = function () {
                this.guide_index++,
                    this.guide_index >= this.guide_info_view.length
                        ? ((n.GlobalParams.JoinGuideMode.value = !1), this.node.parent.destroy())
                        : this.showGuideInfo();
            }),
            (t.prototype.showhandAnime = function () {
                var e = this;
                null != this.hand_anime && this.hand_anime.stop();
                var t = this.guide_info_view[this.guide_index].children[0],
                    o = t.getPosition();
                (this.hand_anime = cc
                    .tween(t)
                    .by(0.8, { position: this.hand_pos[this.guide_index] })
                    .call(function () {
                        t.setPosition(o), e.hand_anime.start();
                    })),
                    this.hand_anime.start();
            }),
            oo([l(cc.Node)], t.prototype, "guide_info_view", void 0),
            oo([l(cc.Node)], t.prototype, "continue_btn", void 0),
            oo([s], t)
        );
    })(a.default);
o.default = _;
